<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>选项卡</title>
	<style>
		*{padding:0;margin:0;}
		ul li{
			list-style:none;
		}
		li{
			float:left;
			width:100px;
			height:40px;
			line-height:40px;
			text-align:center;
			border:1px solid red;
			background-color:pink;
		}
		div{
			position:absolute;
			top:42px;
			left:0;
			width:300px;
			height:300px;
			border:1px solid blue;
		}
		div:nth-of-type(1){
			background-color:red;
		}
		div:nth-of-type(2){
			background-color:green;
		}
		div:nth-of-type(3){
			background-color:blue;
		}
	</style>
</head>
<body>
	<ul>
		<li onmouseover="move(0)" >江苏</li>
		<li onmouseover="move(1)" >安徽</li>
		<li onmouseover="move(2)" >四川</li>
	</ul>
	<div style="display:none" >南京</div>
	<div style="display:none" >合肥</div>
	<div style="display:none" >成都</div>
</body>
	<script>
		list1 = document.getElementsByTagName("li");
		list2 = document.getElementsByTagName("div");
		function move(m){
			for(var i=0;i<list1.length;i++){
				if(i==m){
					list2[i].style.display="block";
				}else{
					list2[i].style.display="none";
				}
			}
		}

	</script>
</html>